<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.0.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/zqmbootstrap.min.css">
    <style>
        .head-back{
            background: #f07491;
            background: linear-gradient(to right, #f87d67, #f17c98) no-repeat 0 0 / cover;
        }
        .nav>li>a{
            color: #f8f2f4;
        }
    </style>
    <script>
        $(document).ready(function () {
            switch (location.pathname) {
                case "${pageContext.request.contextPath}/animation/showAllSimple":
                    $("#catalogue").addClass("active");
                    break;
                case "${pageContext.request.contextPath}/animation/topList":
                    $("#ranking").addClass("active");
                    break;
                case "${pageContext.request.contextPath}/animation/index":
                    $("#index").addClass("active");
                    break;
                default:
                    break;
            }
            $("#user-msg").click(function () {
                location.href = "${pageContext.request.contextPath}/myself/commentsList";
            })
        })
    </script>
</head>
<body>
<div class="container">
    <div class="jumbotron head-back" style="padding-bottom: 0px;padding-top: 0px;position: relative;">
        <div class="col-md-6">
            <h1 style="display: inline;">花瓣</h1>
            <h3 style="display: inline;">   遇见一个好番</h3><br>
        </div>

        <div class="col-md-6" style="margin-bottom: 40px;margin-top: 20px;">
            <form class="bs-example bs-example-form" method="post" action="${pageContext.request.contextPath}/animation/toSearch">
                <div class="input-group">
                    <input type="text" class="form-control" id="searchName" name="search" value="${sessionScope.search.aname}">
                    <span class="input-group-btn">
                            <button class="btn btn-default" type="submit">搜索</button>
                    </span>
                </div>
            </form>
        </div>

        <ul class="nav nav-tabs">
            <li id="index"><a href="${pageContext.request.contextPath}/animation/index">首页</a></li>
            <li id="catalogue"><a href="${pageContext.request.contextPath}/animation/showAllSimple">目录</a></li>
            <li id="ranking"><a href="${pageContext.request.contextPath}/animation/topList">排行榜</a></li>
        </ul>
        <span style="position: absolute; right: 20px; bottom: 10px; font-size: 20px; color: #f8f2f4;
            ${sessionScope.user == null ? "display: none" : ""}">你好！<a id="user-msg" style="color: #FFFFFF">${sessionScope.user.name}</a>
            ｜<a href="${pageContext.request.contextPath}/user/exit" style="color: #f8f2f4;">退出</a>
        </span>
        <span style="position: absolute;right: 20px; bottom: 10px; font-size: 20px; color: #f8f2f4;
            ${sessionScope.user != null ? "display: none" : ""}">
                <a href="${pageContext.request.contextPath}/user/toLogin"  style="color: #f8f2f4;">登录</a>
                ｜
                <a href="${pageContext.request.contextPath}/user/toRegister" style="color: #f8f2f4;">注册</a>
        </span>
    </div>
</div>
</body>
</html>
